package thread;

public class Killer extends  Thread {
    public Killer(String n){
        super(n);
    }

    @Override
    public void run() {
        for(int i=1;i<=10;i++){
            System.out.println(this.getName()+"来了");
            try {
                sleep(20);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }

    public static void main(String[] args) {
        Killer k1=new Killer("秦安东");
        Killer k2=new Killer("lijinze");

        k1.start();
        k2.start();
        try {
            k1.join();
            k2.join();
        }catch (Exception e){
            e.printStackTrace();
        }
        System.out.println(Thread.currentThread().getName()+"到齐了就去踢场子");
    }
}
